package View.Components;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;

public class PictureJPanel extends JPanel {
	private static final long serialVersionUID = -6606097366576281140L;
	private BufferedImage image;
	private Dimension dim;
	
	public PictureJPanel(BufferedImage bi){
		super();
		image = bi;
		dim = new Dimension(image.getWidth(), image.getHeight());
	}
	
	public void setSize(Dimension dim){
		this.dim = dim;
	}
	
    public void paintComponent(Graphics g) {
        g.drawImage(image, 0, 0, dim.width, dim.height, null);
    }
}
